package com.itheima.controller;


import com.itheima.entity.EmpQueryParam;
import com.itheima.entity.PageBean;
import com.itheima.entity.Result;
import com.itheima.service.ClazzService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController

public class ClazzController {

    @Autowired
    private ClazzService clazzService;


    /**
     * 分页查询
     *
     * @param
     * @param
     * @return
     */
    @GetMapping("/clazzs")
    public Result page(EmpQueryParam param) {

        log.info("分页查询:{},{},{},{},{}", param.getName(), param.getBegin(),
                param.getEnd(), param.getPage(), param.getPageSize());

        PageBean pageBean = clazzService.page(param);

        return Result.success(pageBean);
    }
}
